package org.jeecg.modules.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.poi.ss.formula.functions.T;
import org.jeecg.modules.system.entity.RedInformation;
import org.jeecg.modules.system.entity.RedInformationSum;

import java.util.List;

/**
 * @Description: 红色信息表
 * @Author: jeecg-boot
 * @Date:   2025-04-29
 * @Version: V1.0
 */
@Mapper
public interface RedInformationMapper extends BaseMapper<RedInformation> {

    @Delete("delete from red_information")
    void deleteAll();

    @Select("select GROUP_CONCAT(info_id SEPARATOR '/')  as infoId,supplier,sub_settlement as subSettlement,rate,sum(tax_amount) as taxAmount,sum(tax_free_amount) as taxFreeAmount,sum(total_tax_price)as totalTaxPrice from red_information GROUP BY supplier,sub_settlement,rate")
    List<RedInformationSum> selectSumInfo();
}
